﻿function ToggleShowDeletedItems(showDeleted) {
    if (showDeleted) {
        $('.DeletedItem').not('.HDCExperimentTemplate').show();
    }
    else {
        $('.DeletedItem').not('.HDCExperimentTemplate').hide();
    }
}

$(window).load(function () {
    $('.ShowDeletedItemsCheckBox > input').change(function () {
        var showDeleted = $(this).is(':checked');
        ToggleShowDeletedItems(showDeleted);
    });

    var showDeleted = $('.ShowDeletedItemsCheckBox > input').is(':checked');
    ToggleShowDeletedItems(showDeleted);

    //Add a thumbnail image. We do it here, when the page has loaded, as if a URL is missing we don't slow down the page loading
    $('a.ExperimentThumbnail').each(function (index) {
        $('<br />').prependTo($(this).parent());
        $('<img />').attr('src', $(this).attr('href')).addClass("ExperimentThumbnail").prependTo($(this).parent());
    });
});